import React, { memo, Suspense, Fragment } from "react";
import { renderRoutes } from "react-router-config";
import { routes } from "./routes";
import { HashRouter } from "react-router-dom";
import { Provider } from "react-redux";
import store from "@/store";

const App = memo(() => {
  return (
    <Fragment>
      <Provider store={store}>
        <Suspense>
          <HashRouter fallback={<div>loading...</div>}>
            {renderRoutes(routes)}
          </HashRouter>
        </Suspense>
      </Provider>
    </Fragment>
  );
});

export default App;
